Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

336
Visualizações
JavaScript rendering [object Object] in page rather than data

Hi all I am using the following code to render an excel document in an AG Grid

  function populateGrid(workbook) {
    // our data is in the first sheet
    var firstSheetName = workbook.SheetNames[0];
    var worksheet = workbook.Sheets[firstSheetName];
  
    // we expect the following columns to be present
    var columns = {
      A: 'BQ Id',
      B: 'Ref:-',
      C: '',
      D: 'Description',
      E: 'Qty',
      F: 'Unit',
      G: 'Rate',
      H: 'Amount',
    };
  
    var rowData = [];
  
    // start at the 2nd row - the first row are the headers
    var rowIndex = 2;
  
    // iterate over the worksheet pulling out the columns we're expecting
    while (worksheet['A' + rowIndex]) {
      var row = {};
      Object.keys(columns).forEach(function (column) {
        row[columns[column]] = worksheet[column + rowIndex].w;
      });
  
      rowData.push(row);
  
      rowIndex++;
    }
  
    // finally, set the imported rowData into the grid
    gridOptions.api.setRowData(rowData);
  }

This is taken from the AG Grid docs https://www.ag-grid.com/javascript-data-grid/excel-import/ however when I run this code I get the following: Output here How can I get the code to render the actual data?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda